﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {int c=0;
        public Form1()
        {
            InitializeComponent();
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("de");
        }

        private void label1_Click(object sender, EventArgs e)
        {
           
        }
        private void ChangeLanguage(string lang)
{
  foreach (Control c in this.Controls)
  {
    ComponentResourceManager resources = 
          new ComponentResourceManager(typeof(Form1));
    resources.ApplyResources(c,c.Name,new CultureInfo(lang));
  }
        }
        private void button4_Click(object sender, EventArgs e)
        {
            var myForm = new Form2();
            myForm.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.Icon1;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form Form1 = new Form();
            this.Icon=Form1.Icon;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            {
                int a = 0, b = 0;
                if (c == 0) a = 1;
                else b = 0;
                if (a == 1)
                {
                    ChangeLanguage("sr-Cyrl-RS");
                    b = 1;
                    c = 1;
                }

                if (b == 0)
                {
                    ChangeLanguage("en");
                    c = 0;
                }
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }
    }
}
